// ===============================================
// app_preferences
//
// Create by will on 2/23/21 7:43 PM
// Copyright @polynesia.All rights reserved.
// ===============================================

import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart';

part 'app_preferences.g.dart';

@CopyWith()
@JsonSerializable(genericArgumentFactories: true)
class AppPreferences {
  AppPreferences({
    // this.apiBaseURL,
    // this.apiLines,
    // this.githubUrl,
    this.themeMode,
    this.multipleThemesMode,
    this.languageCode,
    this.countryCode,
    this.lastLogin,
  });

  factory AppPreferences.fromJson(Map<String, dynamic> json) =>
      _$AppPreferencesFromJson(json);

  /// 主题模式
  ThemeMode? themeMode;

  /// 多主题模式
  String? multipleThemesMode;

  /// 语言
  String? languageCode;

  /// 语言编码
  String? countryCode;

  DateTime? lastLogin;

  Map<String, dynamic> toJson() => _$AppPreferencesToJson(this);
}
